#include<bits/stdc++.h>
using namespace std;
#define int long long

struct cheese {
	double x, y;
} a[20];

int maxn;
int n;

double ans = INT_MAX;
double f[(1 << 15) - 1];
bool vis[20];

void dfs(int k, double now_distance, double pre_x, double pre_y) {
	if (now_distance >= f[k])	return ;
	if (now_distance >= ans)	return ;
	if (k == maxn) {
		ans = min(ans, now_distance);
		return ;
	}

	for (int i = 1; i <= n; i++) {
		if (vis[i])	continue;

		double delta = sqrt((a[i].x - pre_x) * (a[i].x - pre_x) + (a[i].y - pre_y) * (a[i].y - pre_y));
		if (f[k] + delta < f[k xor (1 << i)]) {
			double tmp = f[k xor (1 << i)];
			f[k xor (1 << i)] = f[k] + delta;
			dfs(k xor (1 << i), now_distance + delta, a[i].x, a[i].y);
			f[k xor (1 << i)] = tmp;
		}
	}
}

signed main() {
	freopen("D:\\code\\OJ code\\LuoGu\\P1433_10.in", "r", stdin);

	cin >> n;
	maxn = (1 << n) - 1;

	for (int i = 1; i <= maxn; i++)
		f[i] = 0x3f3f3f3f;

	for (int i = 1; i <= n; i++)
		cin >> a[i].x >> a[i].y;

	dfs(0, 0, 0, 0);
	cout << ans;
	return 0;
}
